Transform a file that has no beams section - #240
Merged
Conversation
A jbeam file is not obliged to have a beams section, and classifying, sorting and renaming need none. Only support classification reads beams, and without them the answer is that there are no support nodes. transform fails the whole file instead, and the tool still exits 0, so a run over a directory leaves such files untouched without saying why.
The spec said it classified nothing as support and only counted the nodes, which stays at four whether or not a support tree is created, since support extraction moves nodes rather than dropping them. It now looks for the side comment the transformation writes above a support tree, which is absent exactly when no such tree exists.
The four that cannot hold a comment are right to return nothing, but the wildcard would have returned nothing for a new constructor that can hold one, and the spec would have gone green for having looked in the wrong place. Naming them makes GHC refuse to compile when Node grows.
The spec that looked for a missing "Support nodes" comment could not fail: a vertex absent from the connection map is skipped, so an empty map gives an empty result whatever the fix does. The count vertexConns produces is the thing that actually depends on the beams section, and it returns Left today rather than an empty map. The fixture with three beamed hubs stands next to it, so the negative means something.
webdevred
marked this pull request as ready for review
August 28, 2026 19:56
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #229.
A jbeam file is not obliged to have a beams section, and classifying, sorting and renaming need none. Only support classification reads beams, and without them the answer is simply that no node is a support node.
transformfails the whole file instead.The failure is quiet. The tool prints the reason to stderr and exits 0, so a run over a directory leaves those files untouched and reports nothing. That is the same shape as the parse failures fixed in #238, where 97 stock files were silently skipped.